package com.cskaoyan.market.service.impl;

import com.cskaoyan.market.db.domain.MarketGoodsExample;
import com.cskaoyan.market.db.mapper.MarketGoodsMapper;
import com.cskaoyan.market.service.MarketGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName MarketGoodsService
 * @Description: TODO
 * @Author 远志 zhangsong@cskaoyan.onaliyun.com
 * @Date 2023/4/1 10:20
 * @Version V1.0
 **/
@Service
public class MarketGoodsServiceImpl implements MarketGoodsService {

    @Autowired
    MarketGoodsMapper goodsMapper;

    @Override
    public int countOfSale() {
        MarketGoodsExample goodsExample = new MarketGoodsExample();
        goodsExample.or().andIsOnSaleEqualTo(true);
        return (int) goodsMapper.countByExample(goodsExample);
    }
}
